package com.utils;

import com.google.gson.JsonArray;
import com.google.gson.JsonIOException;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;

public class RJSONNeteasesinger {
	private static JsonObject subObject = new JsonObject();

	public static JsonObject parseJSON(JsonObject album) {
		try {
			JsonArray artists = album.get("artists").getAsJsonArray();
			for (int i = 0; i < artists.size(); i++) {
				// 这里不用强转，而用 getAsJsonObject() 进行转换
				subObject = artists.get(i).getAsJsonObject();
			}
		} catch (JsonIOException e) {
			e.printStackTrace();
		} catch (JsonSyntaxException e) {
			e.printStackTrace();
		}
		return subObject;
	}
}
